UPDATE QUERY



MySQL - Update Query


Update statement is used to modify the existing records in a table.


SYNTAX

UPDATE table_name
SET column1 = value1, column2 = value2, ...
WHERE condition;

First we will assume a table with details:


StudentIdStudentNameParentNameAddressPostalCodeCity
1SanjanajagannathBanjara Hills500046Hyderabad
2ShivanatiniPraveenCamel street700096Kolkata

NOW,lets check out how the UPDATE query works:


Example - Update single column


UPDATE studentrecord
SET StudentName = 'Anasya'
WHERE StudentID = 1;

The result will be displayed as follows:

StudentIdStudentNameParentNameAddressPostalCodeCity
1AnasyajagannathBanjara Hills500046Hyderabad
2ShivanatiniPraveenCamel street700096Kolkata

Example - Update multiple columns :


UPDATE studentrecord
SET Address = 'Hayath nagar',
    City = 'Noida'
WHERE StudentID = 2;

The result will be displayed as follows:

StudentIdStudentNameParentNameAddressPostalCodeCity
1AnasyajagannathBanjara Hills500046Hyderabad
2ShivanatiniPraveenHayath nagar700096Noida


MySQL TRIGGERS

MySQL - Triggers

posted on 2019-11-29 21:44:07 - mysql Tutorials


Grant_ Revoke Privilege

MySQL - Grant_ Revoke Privilege

posted on 2019-11-26 23:15:04 - mysql Tutorials


MySQL Vs SQL

MySQL Vs SQL

posted on 2019-11-25 05:02:26 - mysql Tutorials


Prompt Examples

ChatGPT Prompt Examples

posted on 2023-06-21 22:37:19 - ChatGPT Tutorials


Use Cases

Chat GPT Key Use Cases

posted on 2023-06-21 21:03:17 - ChatGPT Tutorials


Prompt Frameworks

Prompt Frameworks

posted on 2023-06-21 19:33:06 - ChatGPT Tutorials